package com.paitoubing.springboot.Controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

//@RestController
@Controller
@RequestMapping("/main")
public class HelloController {

    @RequestMapping("/hello")
    @ResponseBody
    public String hello(){
        return "hello word";
    }

    /**
     * 自动跳转到templates/success.html页面
     * @return
     */
    @RequestMapping("/success")
    public String success(Map<String, Object> map){
        map.put("hello", "ojbk");
        return "success";
    }
}
